package com.zaozhuang.robot.request;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * 求职信息实体类
 */
public class JobApplication implements Serializable {
    // 字段定义
    private String name;          // 姓名
    private String idNumber;      // 身份证号
    private String phoneNumber;   // 手机号
    private String submitTime;    // 提交时间（格式：yyyy-MM-dd HH:mm:ss）
    private String company;       // 求职公司
    private String position;      // 求职岗位

    // 无参构造（自动生成提交时间）
    public JobApplication() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
        this.submitTime = sdf.format(new Date());
    }

    // 全参构造
    public JobApplication(String name, String idNumber, String phoneNumber, String company, String position) {
        this.name = name;
        this.idNumber = idNumber;
        this.phoneNumber = phoneNumber;
        this.company = company;
        this.position = position;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
        this.submitTime = sdf.format(new Date());
    }

    // Getter & Setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getSubmitTime() {
        return submitTime;
    }

    // 提交时间通过构造方法自动生成，不提供setter

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    // 格式化输出
    @Override
    public String toString() {
        return "求职信息 {" +
                "姓名='" + name + '\'' +
                ", 身份证号='" + idNumber + '\'' +
                ", 手机号='" + phoneNumber + '\'' +
                ", 提交时间='" + submitTime + '\'' +
                ", 求职公司='" + company + '\'' +
                ", 求职岗位='" + position + '\'' +
                '}';
    }
}
